package cn.xxd.service;

import cn.xxd.OrderServiceInterface;
import cn.xxd.dao.OrderDao;
import cn.xxd.entity.*;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service(version = "1.0.0", interfaceClass = OrderServiceInterface.class)
public class OrderServiceImpl implements OrderServiceInterface {

    @Autowired
    private OrderDao orderDao;

    // 未使用
    @Override
    public ReturnT createOrder(XxdOrder xxdOrder) {
        return null;
    }

    @Override
    public int save(XxdOrder order) {
        return orderDao.save(order);
    }

    @Override
    public int saveOrderItem(XxdOrderItem xxdOrderItem) {
        return orderDao.saveOrderItem(xxdOrderItem);
    }

    @Override
    public XxdOrder queryOrder(String id) {
        return orderDao.queryOrder(id);
    }

    @Override
    public List<OrdersItems> queryOrdersItems(String userId, String PayType) {

        return orderDao.queryOrdersItems(userId, PayType);
    }

    @Override
    public int modifyPayTye(Integer type, String orderId) {

        return orderDao.modifyPayTye(type, orderId);
    }

    @Override
    public int saveTrade(XxdOrderTrade xxdOrderTrade) {
        return orderDao.saveTrade(xxdOrderTrade);
    }

    @Override
    public int delOrder(String id) {
        return orderDao.delOrder(id);
    }

    @Override
    public int deleteOrderItems(String id) {
        return orderDao.deleteOrderItems(id);
    }


}
